// index.js
// 获取应用实例
const app = getApp()
import { request } from "../../request/index.js";
Page({
  data: {
     // 轮播图数组
     swiperList: [],
     //招聘信息集合
     postList:[]
  },
  
  onLoad() {
      this.getSwiperList();
      this.getHostPostList();
  },
//获取轮播图数据  
getSwiperList(){
    var data = [
      {
        image_src:'https://gxuwz-wnx.oss-cn-beijing.aliyuncs.com/images/banner1.jpg',
        navigator_url: ''
      },
      {
        image_src:'https://gxuwz-wnx.oss-cn-beijing.aliyuncs.com/images/banner2.jpg',
        navigator_url: ''
      },
      {
        image_src:'https://gxuwz-wnx.oss-cn-beijing.aliyuncs.com/images/banner3.jpg',
        navigator_url: ''
      }
    ]

    this.setData({
      swiperList:data
    })
 
},
//获取职业集合数据
getHostPostList(){
  request({
    url:"/mini/post/findHostPostList",
    method:"GET"
  }).then(res=>{
    console.log(res.data)
    this.setData({
      postList:res.data   
    })
  })
},

//跳转到招聘信息列表页面
toPostList(){
  wx.navigateTo({
    url: '/pages/post_list/index'
  })
},
})
